package com.google.code.p.localspinner.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ItemList implements Serializable{
  private static final long serialVersionUID = 1L;
  
  public static enum Type{
      MOVIE, LOCAL, EVENTS, USER
  }

  
  private List<Item> items = new ArrayList<Item>(12);
  private String listName;
  private Type type = Type.USER;
  
  public Type getType() {
    return type;
  }
  
  public void setType(Type type) {
    this.type = type;
  }
  
  public List<Item> getItems() {
    return items;
  }
  
  public void setListName(String listName) {
    this.listName = listName;
  }

  public String getListName() {
    return listName;
  }
  
  public void addItem(Item item){
    items.add(item);
  }
  public Item getItem(int i){
    if(i >= items.size()){
      i = i % items.size();
    }
    return items.get(i);
  }
  
  public int size(){
      return items.size();
  }
  
  @Override
  public String toString() {
    return items.toString();
  }
}
